package com.waitingresult;

/**
 * @Author: WangShuai
 * @CreateTime: 2024/03/05  09:58
 * @Description: 上三角
 * @Version: 1.0
 */
public class UpTriangle {
    public static void main(String[] args) {
        System.err.println(upTriangle(3));
    }

    public static String upTriangle(int n) {
        StringBuilder result = new StringBuilder();
        for (int i = 1; i <= n; i++) {
            for (; n < i; i++) {
                result.append(" ");
            }
            result.append(i);
        }
        return result.toString();
    }
}
